#region Microsoft Public License
/*
 * (c) Copyright Chenjun Wu. http://utablesdk.codeplex.com
 * 
 * This source is subject to the Microsoft Public License (Ms-PL).
 * Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
 * All other rights reserved.
 */
#endregion

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using UTable.Input;
using UTable.Input.MultiTouch;

namespace UTable.Objects.Handlers
{
	public class OneFingerHandler: NFingersHandler
	{

		#region override Methods

		protected override void OnNFingersDown(List<FingerPoint> fingers)
		{
			switch (fingers.Count)
			{
				case 1:
					OnOneFingerDown(fingers);
					if (OneFingerDown != null)
						OneFingerDown(fingers);
					break;
			}
		}

		protected override void OnNFingersUp(List<FingerPoint> fingers)
		{
			switch (fingers.Count)
			{
				case 1:
					OnOneFingerUp(fingers);
					if (OneFingerUp != null)
						OneFingerUp(fingers);
					break;
			}
		}

		protected override void OnNFingersMove(List<FingerPoint> oFigners, List<FingerPoint> nFingers)
		{
			switch (oFigners.Count)
			{
				case 1:
					OnOneFingerMove(oFigners, nFingers);
					if (OneFingerMove != null)
						OneFingerMove(oFigners, nFingers);
					break;
			}
		}

		#endregion

		#region Virtual Methods

		#region Deal With One Finger Operation

		protected virtual void OnOneFingerDown(List<FingerPoint> fingers)
		{

		}

		protected virtual void OnOneFingerMove(List<FingerPoint> oFigners, List<FingerPoint> nFingers)
		{

		}

		protected virtual void OnOneFingerUp(List<FingerPoint> fingers)
		{

		}
		#endregion

		#endregion

		#region Events

		public event FingersDownEventHandler OneFingerDown;

		public event FingersMoveEventHandler OneFingerMove;

		public event FingersUpEventHandler OneFingerUp;

		#endregion
	}

	public delegate void FingersDownEventHandler(List<FingerPoint> fingers);

	public delegate void FingersMoveEventHandler(List<FingerPoint> oFigners, List<FingerPoint> nFingers);

	public delegate void FingersUpEventHandler(List<FingerPoint> fingers);
}
